//所在地区
var pageRegionBtn = document.getElementsByClassName("page_region_btn")[0];
var regionPrefecture = document.getElementById("region_prefecture");
var prefectureHdColse = document.getElementById("prefecture_hd_colse");
var textRegion = document.getElementById("text_region");
var prefectureBdUl = document.getElementById("prefecture_bd_ul");
var prefectureLis = prefectureBdUl.getElementsByTagName("li");
var pageBdLnfo = document.getElementsByClassName("page_bd_info");
console.log(pageBdLnfo);
var inps = pageBdLnfo[0].getElementsByTagName("input");
console.log(inps);

textRegion.onclick = pageRegionBtn.onclick = function(){
    regionPrefecture.style.display = "block";
}

prefectureHdColse.onclick = function(){
    regionPrefecture.style.display = "none";
}
var index1 = 0;
for(var j=0; j<inps.length;j++){
    inps[j].suoyin1 = j;
    inps[j].onclick = function(){
        index1 = this.suoyin1;
        inps[index1].placeholder = "";
    }
}
inps[0].onblur = function(){
    inps[0].placeholder = "请输入姓名";
}
inps[1].onblur = function(){
    inps[1].placeholder = "请输入手机号码";
}
inps[3].onblur = function(){
    inps[3].placeholder = "请输入街道地址";
}
var index = 0;
for(var i=0;i<prefectureLis.length;i++){
    prefectureLis[i].suoyin = i;
    prefectureLis[i].onclick = function(){
        index = this.suoyin;
        textRegion.value = prefectureLis[index].innerHTML;
    }
}










// 单选按钮  设置默认地址
var pageDefaultBtn  = document.getElementsByClassName("page_default_btn")[0];
console.log(pageDefaultBtn);
var pageBefaultBtnDot = document.getElementsByClassName("page_default_btn_dot")[0];
console.log(pageBefaultBtnDot);
pageDefaultBtn.onclick = function(){
    pageBefaultBtnDot.style.display = "block";
}